public class GirfriendText {
    public static void main(String[] args) {
        Girlfriend[] arr = new Girlfriend[4];
        Girlfriend gif1 = new Girlfriend("小诗诗", 18, "萌妹子", "吃零食");
        Girlfriend gif2 = new Girlfriend("小丹丹", 19, "萌妹子", "看书,学习");
        Girlfriend gif3 = new Girlfriend("小莉莉", 20, "萌妹子", "玩游戏");
        Girlfriend gif4 = new Girlfriend("小惠惠", 21, "憨妹子", "睡觉");
        arr[0] = gif1;
        arr[1] = gif2;
        arr[2] = gif3;
        arr[3] = gif4;
        int sum = 0;
        for (int i = 0; i < arr.length; i++) {
            sum = sum + arr[i].getAge();
        }
        int average = sum / arr.length;
        System.out.println("平均年龄为" + average);
        int count = 0;
        for (int i = 0; i < arr.length; i++) {
            if (arr[i].getAge() < average) {
                System.out.println(arr[i].getName() + " " + arr[i].getAge() + " " + arr[i].getGender() + " " + arr[i].getHobby());
                count++;
            }
        }
        System.out.println(count + "个");
    }
}
